<template>
  <router-view></router-view>
</template>
<script setup>
import { reactive } from "vue";

const useDict = (...args) => {};
useDict(1, 2, 3);

const asynchronous = () => {
  return new Promise((resolve, reject) => {
    //  console.log(1);
    setTimeout(() => {
      //  console.log(4);
    });
    resolve(3);
  });
};
asynchronous().then((e) => {
  //console.log(e);
});
//console.log(2);
//执行顺序1，2，3，4

const testFunc = () => {
  let name = "张三";
  let age = "18";
  console.log("name++", name);
  const getName = () => {
    console.log(name);
    return name;
  };
  const getAge = () => {
    return age;
  };
  getName();
};
testFunc();

if (0) {
  console.log("类型判断-------------------------------------true");
} else {
  console.log("类型判断-------------------------------------false");
  console.log(typeof [9527], "9527"); // object
  console.log(typeof ("web" - 9527), "web"); // number
  console.log(typeof null); // object  表示不存在的对象
  console.log(typeof (() => {})); // function
  console.log(Object.prototype.toString.call(9527)); //[object Number]
  console.log({} instanceof Object); //true
}

//0 fasle null undefined NaN ''

/**自执行函数（立即执行）*/
(function (i) {
  console.log(i);
})("自执行函数");

console.log("1");
async function async1() {
  await async2();
  console.log("2");
}

async function async2() {
  console.log("3");
}

async1();

setTimeout(function () {
  console.log("4");
}, 0);

new Promise((resolve) => {
  console.log("5");
  resolve();
})
  .then(function () {
    console.log("6");
  })
  .then(function () {
    console.log("7");
  });

console.log("8");
//1、3、5、8、2、6、7、4

let Base = {
  name: "base",
};
let A = function () {
  this.name = "a";
};
A.prototype = Object.create(Base);
let a = new A();
Base.name = "new_name";
console.log(a.name); //a
delete a.name;
console.log(a.name);//base
</script>
<style lang="scss">
</style>

